Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

klor

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

klor

syntax highlighting

  • 2.17.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
120
decreased by-60.13%
Maintainers
1
Weekly downloads
 
Created
Source

klor

klor is a simple syntax highlighting tool. It exports the following function:

parse lines, ext

  • lines: array of strings
  • ext: file type
    • coffee js ts
    • styl css sass
    • pug html svg
    • bash fish sh
    • cpp hpp c h
    • noon json
    • md plist

returns an array of objects:

[
    ext:    string              
    chars:  number              
    index:  number              
    number: index+1 
    chunks: [
                match:  string  # without whitespace characters
                clss:   string  # value of match
                turd:   string  # following punctuation characters
                start:  number  # character index of match in line
                length: number  # length of match
            ]
...
]

See kolor.map for a list of recognized chunk values.

🌈 kolor

kolor is a submodule which exports a bunch of functions for wrapping strings in 256 color ansi codes.

It's a merge of colorette and ansi-256-colors

  • [r g b c m y w][1..8] foreground colors
  • [R G B C M Y W][1..8] background colors
klor = require 'klor'
klor.kolor.globalize() # hoist color functions into the global scope
log y8 'bright yellow' + R1 'on dark red'

npm package Build Status downloads

Keywords

FAQs

Package last updated on 02 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc